From 5fd2b38c343a94407863d9fa0820aa251c3d354c Mon Sep 17 00:00:00 2001
From: Petri Hintukainen <phintuka@gmail.com>
Date: Sun, 13 Mar 2016 12:27:02 +0200
Subject: [PATCH 4/5] Fix check for empty home dir

---
 src/libdvdcss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index ac90030..6e5d6e1 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -234,7 +234,7 @@ static int set_cache_directory( dvdcss_t dvdcss )
 
         /* Try looking in password file for home dir. */
         p_pwd = getpwuid(getuid());
-        if( p_pwd && p_pwd[ 0 ] )
+        if( p_pwd && p_pwd->pw_dir && p_pwd->pw_dir[ 0 ] )
         {
             psz_home = p_pwd->pw_dir;
         }
-- 
2.10.0

